package com.umxwe.kill.seckill.controller;


import com.umxwe.kill.core.domain.Result;
import com.umxwe.kill.core.template.ResultGenerator;
import com.umxwe.kill.seckill.service.KillInfoService;
import com.umxwe.kill.seckill.vo.killInfoVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("killInfo")
@Api(tags = "秒杀信息")
public class SeckillInfoController {


    @Autowired
    private KillInfoService killInfoService;

    @Value(value = "${foo}")
    private String foo ;

    @GetMapping("getOne")
    @ApiModelProperty("获取秒杀信息")
    public Result<killInfoVo> getOne(){
        System.out.println(foo);
        return ResultGenerator.genSuccessResult(killInfoService.getOne(1L));
    }

}
